package demo.listener;

import demo.binder.InputBinding;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;

@EnableBinding(InputBinding.class)
public class KafkaReceiver {

    private static Logger logger = LoggerFactory.getLogger(KafkaReceiver.class);

    @StreamListener(value = InputBinding.INPUT_1)
    public void receive(String payload) {
        logger.info("INPUT_1 received:" + payload);
    }

    @StreamListener(value = InputBinding.INPUT_2)
    public void receive2(String payload) {
        logger.info("INPUT_2 received:" + payload);
    }
}
